<?php get_instance()->view('common/header');?>
<style type="text/css">
    .reason{border: 1px solid #e5e5e5;height: 100px;margin-top: 10px;overflow: auto;}
    .reason>p{position: relative;margin: 5px 0 0 5px;}
    .reason>p>i{position: absolute;right: 1px;top: -2px;color: red;font-weight: 200;}
    .set-box{border: 1px solid #e5e5e5;height: 100px;margin-top: 10px;overflow: auto;}
    .set-box>p{position: relative;margin: 5px 0 0 5px;}
    .set-box>p>i{position: absolute;right: 1px;top: -2px;color: red;font-weight: 200;}
    .delete{position: absolute;right: -0.35em;top: -0.35em;width: 0.9em;}
    .btn-info{background: #eee;border-radius: 3px !important;}
    .btn-info>span{font-size: 12px;color: #000;}
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"> <?php echo $title?> </h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('home');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li> <i class="fa fa-home"></i> <a href="<?php echo getUrl('home');?>"> 首页  <i class="fa fa-angle-right"></i> </a></li>
                        <li><a href="#"><?php echo $title?><i class="fa fa-angle-right"></i></a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <!--开始-->
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN VALIDATION STATES-->
                    <div class="portlet box">
                        <div class="portlet-body form">
                            <!-- BEGIN FORM-->
                            <form action="" class="form-horizontal" method="post" novalidate="novalidate" id="frm">
                                <div class="form-body">
                                	<h3>基础配置</h3>
                                    <hr/>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">地图key <span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <input class="form-control required" name="map_key" value="<?php echo $info['map_key']?>" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">客户电话<span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <input class="form-control required" name="customer_tel" value="<?php echo $info['customer_tel']?>" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">最小提现金额 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                             <div class="input-group">
	                                            <input class="form-control required" name="min_withdraw_cash_amount" value="<?php echo $info['min_withdraw_cash_amount']?>" type="text">
												<span class="input-group-addon">
													元
												</span>
											</div>
											<span for="min_withdraw_cash_amount" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">接单范围 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                             <div class="input-group">
												<input class="form-control required" name="deliveryman_range" value="<?php echo $info['deliveryman_range']?>" type="text">
												<span class="input-group-addon">
													m
												</span>
											</div>
											<span for="deliveryman_range" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">接单过期时间 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                             <div class="input-group">
												<input class="form-control required" name="rob_expect_time" value="<?php echo $info['rob_expect_time']?>" type="text">
												<span class="input-group-addon">
													分钟
												</span>
											</div>
											<span for="deliveryman_range" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">定位间隔时间</label>
                                        <div class="col-md-5">
                                             <div class="input-group">
												<input class="form-control" name="postion_time" value="<?php echo $info['postion_time']?>" type="text">
												<span class="input-group-addon">
													秒
												</span>
											</div>
											<span for="postion_time" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                	<h3>配送费</h3>
                                    <hr/>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">基础配送费 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <div class="input-group">
												<input class="form-control required" type="text" name="base_distribution_fee" value="<?php echo $info['base_distribution_fee']?>">
												<span class="input-group-addon">
													元
												</span>
											</div>
											<span for="base_distribution_fee" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">基础配送距离 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <div class="input-group">
												<input class="form-control required" type="text" name="base_distribution_distance" value="<?php echo $info['base_distribution_distance']?>">
												<span class="input-group-addon">
													km
												</span>
											</div>
											<span for="base_distribution_distance" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">基础配送重量 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <div class="input-group">
												<input class="form-control required" type="text" name="base_distribution_weight" value="<?php echo $info['base_distribution_weight']?>">
												<span class="input-group-addon">
													kg
												</span>
											</div>
											<span for="base_distribution_weight" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">超过基础距离收取费用<span class="required">*</span></label>
                                        <div class="col-md-5">
											 <div class="input-group">
                                            	<span class="input-group-addon">
													每超过
												</span>
                                            	<input class="form-control" type="text" name="exceed_base_distance_number" value="<?php echo $info['exceed_base_distance_number']?>">
                                            	<span class="input-group-addon">
													公里收取
												</span>
												<input class="form-control required" type="text" name="exceed_base_distance" value="<?php echo $info['exceed_base_distance']?>">
												<span class="input-group-addon">
													元
												</span>
											</div>
											<span for="exceed_base_distance" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">超过基础重量收取费用 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <div class="input-group">
                                            	<span class="input-group-addon">
													每超过
												</span>
                                            	<input class="form-control" type="text" name="exceed_base_weight_number" value="<?php echo $info['exceed_base_weight_number']?>">
                                            	<span class="input-group-addon">
													千克收取
												</span>
												<input class="form-control required" type="text" name="exceed_base_weight" value="<?php echo $info['exceed_base_weight']?>">
												<span class="input-group-addon">
													元
												</span>
											</div>
											<span for="exceed_base_weight_number" class="help-block validate_message hide"></span>
                                        </div>
                                    </div>
                                    <h3>评论标签配置</h3>
                                    <hr/>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">评论标签配置 <span class="required">*</span></label>
                                        <div class="col-md-5">
                                            <input class="form-control" name="comment_val" type="text">
                                            <div class="set-box comment">
                                                <?php foreach ($info['deliveryman_comment_tags'] as $k => $v):?>
                                                    <p class="btn btn-info">
                                                        <span><?php echo $v?></span>
                                                        <img class="delete delete-comment" src="<?php echo $this->staticUrl;?>img/3.png" alt="">
                                                        <input type="hidden" value="<?php echo $v?>" name="comment[]">
                                                    </p>
                                                <?php endforeach;?>
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                            <a href="javascript:;" class="btn btn-sm comment-btn">
                                                <img src="<?php echo $this->staticUrl;?>img/4.png" class="add-btn1"> 添加
                                            </a>
                                        </div>
                                        <script type="text/javascript">
                                            $(function () {
                                                $(".comment-btn").live('click',function () {
                                                    var vl = $("[name='comment_val']").val();
                                                    if (!vl.length){
                                                        show_message({status:0, message:'请填写评论标签'});
                                                        return false;
                                                    }
                                                    var deleteImg = "<?php echo $this->staticUrl;?>img/3.png";
                                                    var heml = '<p class="btn btn-info">' +
                                                        '<span>'+vl+'</span>' +
                                                        '<img class="delete delete-comment" src="'+deleteImg+'" alt="">' +
                                                        '<input type="hidden" value="'+vl+'" name="comment[]">' +
                                                        '</p>';
                                                    $(".comment").append(heml);
                                                    $("[name='comment_val']").val('');
                                                });

                                                $(".delete-comment").live('click',function () {
                                                    $(this).parent().remove();
                                                });
                                            })
                                        </script>
                                    </div>
                                    <h3>分享</h3>
                                    <hr/>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">分享图标<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <img width="100px" height="100px" id="icn-img" alt="" src="<?php echo $info['sharp_icon'] ? getImage($info['sharp_icon'],'og') : getDefaultImg();?>">
                                            <a class="upload-btn" href="javascript:void(0);">上传图片</a>
                                            <input type="hidden" name="icon" id="pic"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">分享标题<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="sharp_title" value="<?php echo $info['sharp_title']?>" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">分享地址<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="sharp_url" value="<?php echo $info['sharp_url']?>" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">分享描述<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="sharp_desc" value="<?php echo $info['sharp_desc']?>" type="text">
                                        </div>
                                    </div>
                                    <h3>下载</h3>
                                    <hr/>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">安卓版本号<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="android_version" value="<?php echo $info['android_version']?>" type="text">
                                        </div>
                                    </div>
                
                                    <div class="form-group">
                                        <label class="control-label col-md-3">安卓更新内容<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <textarea  class="form-control required" name="android_update_description" ><?php echo $info['android_update_description']?></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">安卓强制更新<span class="required">*</span></label>
                                        <div class="col-md-6" style="margin-left: 18px;">
                                            <div class="radio-list">
                                                <label class="radio-inline"><input name="android_is_forced" <?php if($info['android_is_forced'] == '0'):?> checked<?php endif;?> value="0" type="radio"> 否 </label>
                                                <label class="radio-inline"><input name="android_is_forced" <?php if($info['android_is_forced'] == '1'):?> checked<?php endif;?> value="1" type="radio"> 是 </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">安卓下载地址<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="android_update_url" value="<?php echo $info['android_update_url']?>" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">ios版本号<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="ios_version" value="<?php echo $info['ios_version']?>" type="text">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">ios更新内容<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <textarea  class="form-control required" name="ios_update_description" ><?php echo $info['ios_update_description']?></textarea>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="control-label col-md-3">ios强制更新<span class="required">*</span></label>
                                        <div class="col-md-6" style="margin-left: 18px;">
                                            <div class="radio-list">
                                                <label class="radio-inline"><input name="ios_is_forced" <?php if($info['ios_is_forced'] == '0'):?> checked<?php endif;?> value="0" type="radio"> 否 </label>
                                                <label class="radio-inline"><input name="ios_is_forced" <?php if($info['ios_is_forced'] == '1'):?> checked<?php endif;?> value="1" type="radio"> 是 </label>

                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3">苹果下载地址<span class="required">*</span></label>
                                        <div class="col-md-6">
                                            <input class="form-control required" name="ios_update_url" value="<?php echo $info['ios_update_url']?>" type="text">
                                        </div>
                                    </div>
                                </div>
                                <div class="form-actionsc fluid">
                                    <div class="col-md-offset-3 col-md-9">
                                        <button type="submit" class="btn green"><i class="fa fa-save"></i> 保存</button>
                                        <a href="<?php echo getUrl('home');?>" class="btn default"><i class="fa fa-chevron-left"></i> 返回</a>
                                    </div>
                                </div>
                            </form>
                            <!-- END FORM-->
                        </div>
                    </div>
                    <!-- END VALIDATION STATES-->
                </div>
            </div>
            <!--结束-->
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $.e_validate.init('#frm',{});
    });

    cropitMaster({
        uploadBtn:$('.upload-btn'),
        width:'102px',
        height:'102px',
        complete:function(btn,data){
            $('#icn-img').attr('src', data);
            $('#pic').val(data).change();
        }
    });
</script>
</body>
</html>